Developer Documentation

QuickTime 4 API Documentation

QuickTime 4 Reference

| Previous | Chapter Contents | Chapter Top |

Text Channel Component Reference

This section describes the functions provided by the text channel component for formatting text to be previewed or added to a text track of a movie.

SGSetFontName

The SGSetFontName function sets the name of the font to be used to display text.

pascal ComponentResult SGSetFontName (
                     SGChannel c,
                     StringPtr pstr);
c
Specifies the channel for this operation.

pstr
A pointer to a Pascal string containing the name of the font.

DISCUSSION

You call this function to specify a font for the text channel component. If the specified font is available on the system, the text channel uses the font to display text. If the specified font is not available, the text channel uses the default system font. For more information about fonts, see Inside Macintosh: Text.

RESULT CODES

Component Manager errors, as documented in Mac OS For QuickTime Programmers.

SGSetFontSize

The SGSetFontSize function sets the font size to be used to display text.

pascal ComponentResult SGSetFontSize (
                     SGChannel c,
                     short fontSize);
c
Specifies the channel for this operation.

fontSize
Specifies the point size of the font.

DISCUSSION

You call this function to specify a text point size for the text channel component. The specified point size must be a positive integer value. For more information about fonts and point size, see Inside Macintosh: Text.

RESULT CODES

Component Manager errors, as documented in Mac OS For QuickTime Programmers.

SGSetTextForeColor

The SGSetTextForeColor function sets the color to be used to display text.

pascal ComponentResult SGSetTextForeColor (
                     SGChannel c,
                     RGBColor *theColor);
c
Specifies the channel for this operation.

theColor
Contains a pointer to an RGBColor structure that contains the new text color.

DISCUSSION

You call this function to set the text color for a text track.

RESULT CODES

Component Manager errors, as documented in Mac OS For QuickTime Programmers.

SGSetTextBackColor

The SGSetTextBackColor function sets the background color to be used for the text box.

pascal ComponentResult SGSetTextBackColor (
                     SGChannel c,
                     RGBColor *theColor);
c
Specifies the channel for this operation.

theColor
Contains a pointer to an RGBColor structure that contains the new background color.

DISCUSSION

You call this function to set the background color of a text track. The text channel component uses the specified color as the background of the text box.

RESULT CODES

Component Manager errors, as documented in Mac OS For QuickTime Programmers.

SGSetJustification

The SGSetJustification function sets the alignment to be used to display text.

pascal ComponentResult SGSetJustification (
                     SGChannel c,
                     short just);
c
Specifies the channel for this operation.

just
Specifies a constant that represents the text alignment. Possible values are teFlushDefault , teCenter , teFlushRight , and teFlushLeft .

DISCUSSION

You call this function, passing a text justification constant, to specify the alignment to be used for text in a text track. The text channel component justifies text relative to the boundaries of its text box. For more information on text alignment and the text justification constants, see the "TextEdit" chapter of Inside Macintosh: Text.

RESULT CODES

Component Manager errors, as documented in Mac OS For QuickTime Programmers.

SGGetTextReturnToSpaceValue

The SGGetTextReturnToSpaceValue function indicates whether the text channel component should replace return characters with spaces.

pascal ComponentResult SGGetTextReturnToSpaceValue (
                     SGChannel c,
                     short *rettospace);
c
Specifies the channel for this operation.

rettospace
Contains a pointer to a 16-bit integer. On return, this parameter is true if the text channel is replacing return characters with spaces, or false if the text channel is not replacing return characters with spaces.

DISCUSSION

When you capture text from a closed-caption television source, the text is composed of four lines of text of up to 32 characters each, each line separated by a return character. Sometimes it is useful to replace the return characters with spaces. You can call this function to determine whether the text channel component is replacing return characters with spaces.

RESULT CODES

Component Manager errors, as documented in Mac OS For QuickTime Programmers.

SGSetTextReturnToSpaceValue

The SGSetTextReturnToSpaceValue function sets whether the text channel component should replace return characters with spaces.

pascal ComponentResult SGSetTextReturnToSpaceValue (
                     SGChannel c,
                     short rettospace);
c
Specifies the channel for this operation.

rettospace
Specifies whether return characters should be replaced by spaces. Set this parameter to true if the text channel should replace return characters with spaces, or false if the text channel should not replace return characters with spaces.

DISCUSSION

When you capture text from a closed-caption television source, the text is composed of four lines of text of up to 32 characters each, each line separated by a return character. You call this function to request that the text channel component replace the return characters with spaces.

RESULT CODES

Component Manager errors, as documented in Mac OS For QuickTime Programmers.


© 1999 Apple Computer, Inc.

| Previous | Chapter Contents | Chapter Top |